// 电话号码验证开始
String.prototype.Trim = function() {

    var m = this.match(/^\s*(\S+(\s+\S+)*)\s*$/);

    return (m == null) ? "" : m[1];

}
String.prototype.isMobile = function() {

    return (/^(?:13\d|15[89])-?\d{5}(\d{3}|\*{3})$/.test(this.Trim()));
}

String.prototype.isTel = function()

{
    //"兼容格式: 国家代码(2到3位)-区号(2到3位)-电话号码(7到8位)-分机号(3位)"
    //return (/^(([0\+]\d{2,3}-)?(0\d{2,3})-)?(\d{7,8})(-(\d{3,}))?$/.test(this.Trim()));
    return (/^(([0\+]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/.test(this.Trim()));
}

function chkForm() {

    with(document.form1) {

        if (tel.value.isMobile() || tel.value.isTel()) {

            tel.value = tel.value.Trim();

            return true;
        } else {

            alert("请输入正确的手机号码\n\n例如:13xxx75xx09");

            tel.focus();

            return false;
        }
    }
}
// 电话号码验证结束
// 顶部导航下拉开始
$(function() {
    var site_menu = $(".site_menu"),
        selectDown = $(".selectDown"),
        timer = null;
    // 初始化下拉菜单
    selectDown.hide();
    // 鼠标移入时显示
    $(".site_menu li:nth-child(2)").hover(function() {

        // 获取当前li的下标

        clearTimeout(timer);

        var index = $(this).index();

        selectDown.stop().slideDown(0);

    }, function() {

        clearTimeout(timer);

        timer = setTimeout(function() {

            selectDown.stop().slideUp(0)

        }, 100)

    });

    selectDown.hover(function() {
        // 清除定时炸弹，组断掉slideUp事件触发
        clearTimeout(timer);

    }, function() {
        // 当用户离开时，隐藏listDown
        selectDown.stop().slideUp();

    });
    // 底部横线显示隐藏
    //    $('.siteMenu li').mouseenter(function(event){

    //	var index=$(this).index();

    // alert(index);
    //	$('.underLine li').eq(index).attr('class','currentUn').siblings().attr('class','');
    //	});

});
// 顶部导航下拉结束
// banner开始
$(function() {
    function banner() {
        // 用来模拟点击获取的图片的下标
        var num = 0;
        var imgList = $('.imgList li');
        var btnList = $('.btnList li');
        var banner = $('.banner1');
        var len = btnList.length;
        var timer = null;

        //JQ初始化css
        imgList.first().show();

        // 封装向右走的功能
        function rightFn(event) {
            // 注意，永远我们只需要操作两张图片，num在没有加加之前是代表当前用户正在看到的那张图，加加之后，就表示下一张用户想要看到的图片
            imgList.eq(num).stop().fadeOut(0);
            btnList.eq(num).removeClass('current');
            // 每点击一次就让num加一次
            // 做一个极值判断
            num++;
            if (num > len - 1) {
                num = 0;
            }
            // 让用户想要看到的那一张淡入进来
            imgList.eq(num).stop().fadeIn(0);
            // 让用户想要看到的那一张的角标添加上当前类
            btnList.eq(num).addClass('current');
        }
        //点击角标让对应的图片淡入进来，之前的淡出
        btnList.click(function(event) {
            imgList.eq(num).stop().fadeOut(300);
            btnList.eq(num).removeClass('current');
            // 这里一定注意，将你点击的那个元素的下标值赋值给num取得统一
            num = $(this).index();
            // 让用户想要看到的哪一张淡入进来
            imgList.eq(num).stop().fadeIn(300);
            // 让用户想要看到的哪一张的角标添加上当前类
            btnList.eq(num).addClass('current');
        });


        //点击角标让对应的图片淡入进来，之前的淡出
        $(".link").click(function(event) {
            var typeid = $(this).attr("id");
            switch (typeid) {
                case 'ui-next':
                    if (num > 2) return;
                    imgList.eq(num).stop().fadeOut(300);
                    btnList.eq(num).removeClass('current');
                    num = parseInt(num) + 1;
                    break;
                case 'ui-prev':
                    if (num < 1) return;
                    imgList.eq(num).stop().fadeOut(300);
                    btnList.eq(num).removeClass('current');
                    num = parseInt(num) - 1;
                    break;
            }
            // 这里一定注意，将你点击的那个元素的下标值赋值给num取得统一
            // 让用户想要看到的哪一张淡入进来
            imgList.eq(num).stop().fadeIn(300);
            // 让用户想要看到的哪一张的角标添加上当前类
            btnList.eq(num).addClass('current');
        });

        timer = setInterval(rightFn, 3000);
        //鼠标移动到box上面去的时候清除定时器，离开定时器开启
        banner.hover(function() {
            clearInterval(timer);
        }, function() {
            clearInterval(timer);
            timer = setInterval(rightFn, 3000);
        });
    }
    banner('.banner1');

});

//左右切换键开始

//左右切换键结束
// banner结束


// banner导航开始
$(function() {
    var timer = null;
    var fenleiright1 = $('.fenleiright1');
    var flright1 = $('.flright1');

    $('.navRight li').mouseenter(function() {

        $(this).children('span').css('transform', 'rotate(135deg)');

    }).mouseleave(function() {

        $(this).children('span').css('transform', 'rotate(-45deg)');

    })
    $('.fenlei ul li:first-child').mouseenter(function() {

        $('.fenleiright').fadeTo(0, 1).stop().animate({
            'width': '669px'
        }, 300);

    }).mouseleave(function() {

        clearTimeout(timer);

        $('.fenleiright').stop().fadeIn(400);

    });

    timer = setTimeout(function() {

        $('.fenleiright').stop().fadeOut(400);

    }, 100);

    $('.fenleiright').hover(function() {
        // 清除定时炸弹，组断掉animate事件触发
        clearTimeout(timer);
        $('.fenleiright').stop().fadeIn(400);
    }, function() {

        $('.fenleiright').stop().fadeOut(400);
    });

    $('.fenlei ul li:first-child').mouseleave(function() {

        $('.fenleiright').stop().fadeOut(400);

    });

    // 第二个模块显示与隐藏

    timer1 = setTimeout(function() {

        $('.fenleiright1').stop().fadeOut(400);

    }, 100);

    $('.fenlei ul li:nth-child(2)').hover(function() {

        $('.fenleiright1').fadeTo(0, 1).stop().animate({
            'width': '669px'
        }, 300);

        $('.fenleiright1').hover(function() {

            clearTimeout(timer1);

            $('.fenleiright1').fadeTo(0, 1).stop().animate({
                'width': '669px'
            }, 300);

        }, function() {

            $('.fenleiright1').stop().fadeOut(400);

        });

    }, function() {

        $('.fenleiright1').stop().fadeOut(400);

    });

    // 第三个模块显示与隐藏
    timer1 = setTimeout(function() {

        $('.fenleiright2').stop().fadeOut(400);

    }, 100);

    $('.fenlei ul li:last-child').hover(function() {

        $('.fenleiright2').fadeTo(0, 1).stop().animate({
            'width': '669px'
        }, 300);

        $('.fenleiright2').hover(function() {

            clearTimeout(timer1);

            $('.fenleiright2').fadeTo(0, 1).stop().animate({
                'width': '669px'
            }, 300);

        }, function() {

            $('.fenleiright2').stop().fadeOut(400);

        });

    }, function() {

        $('.fenleiright2').stop().fadeOut(400);

    });

});
// banner导航结束
// 推荐商标开始
$(function() {

    $('.calssify li').mouseenter(function(event) {

        var index = $(this).index();
        switch (index) {
            case 0:
                var tt = 7;
                break;
            case 1:
                var tt = 8;
                break;
            case 2:
                var tt = 9;
                break;
            case 3:
                var tt = 10;
                break;
        }
        adv(tt, 12);
        // alert(index);

        $('.calssify li').eq(index).attr('class', 'curr').siblings().attr('class', '');

        $('.currentShow>li').eq(index).attr('class', 'current').siblings().attr('class', '');
    })
});
// 推荐商标结束

// 小banner开始
$(function() {
    var timer = null;
    // 这个变量是用来控制自动走的下标值
    var num = 0;
    var imgListLit = $('.imgListLit li');
    var box = $('.littleBan');
    var cooper = $('.cooper');
    var arrowLr = $('.arrowLr');
    var em = $('.arrowLr em');
    var i = $('.arrowLr i');
    var len = imgListLit.length;
    var flag = true;
    var huochetou = $('.imgListLit');
    var cloneDom = imgListLit.eq(0).clone(true);
    var boxWidth = $('.littleBan').width();
    var indexNum = 0;

    //将克隆的第一个元素追加到huochetou
    huochetou.append(cloneDom);
    //为什么重新获取这个长度，因为我们新增了li进去了，所以，需要重新获取
    huochetou.width(boxWidth * $('.imgListLit li').length);

    // 点击角标让对应的图片淡入进来，并且其他图片直接消失
    // 点击向右走
    em.click(function(event) {

        if (flag) {

            flag = false;

            rightFn();
        }
    });
    // 点击向左走
    i.click(function() {

        if (flag) {

            flag = false;

            leftFn();
        }
    });

    // 自动走
    timer = setInterval(rightFn, 5000);

    $('.littleBan').hover(function() {

        clearInterval(timer);

        arrowLr.stop().show();

    }, function() {

        clearInterval(timer);

        timer = setInterval(rightFn, 5000);

        arrowLr.stop().hide();
    });

    function rightFn() {
        indexNum++;

        if (indexNum > len - 1) {

            indexNum = 0;

        }

        num++;
        if (num > len) {
            // 一旦满足这个条件，就表示用户想要看到第“一”张，所以先瞬移到第0张，在顺势滑到第一张
            huochetou.css('left', 0);
            // 这个num一定要改成1
            num = 1;
        }

        go();
    }

    function leftFn() {

        indexNum--;

        if (indexNum < 0) {

            indexNum = len - 1;

        }

        num--;

        if (num < 0) {
            // 一旦满足这个条件，就表示用户想要看到倒数第二张（用户眼里的最后一张），所以先瞬移到第最后一张(你们眼里的最后一张)，在顺势（用户眼里的最后一张）
            huochetou.css('left', -len * boxWidth);
            // 这个num一定要改成1
            num = len - 1;
        }

        go();
    }

    // 封装走的功能

    function go() {

        var s = -boxWidth * num;

        var index = $(this).index();

        huochetou.stop().animate({
            'left': s
        }, 1000, function() {

            flag = true;

        });

    }
});
// 小banner结束

// 咨询开始
$(function() {
    var wrong_btn = $('.wrong_btn');
    var footerContact = $('.footerContact');

    wrong_btn.click(function(event) {
        footerContact.stop().hide(600);
        wrong_btn.stop().hide(600);
    });
});
// 咨询结束
// 侧栏咨询开始
$(function() {

    var img = $('.weixn'),
        $li = $('.conRight li:nth-child(3)'),
        timer = null,
        $conRight = $('.conRight'),
        viewHeight = $(window).height(),
        $Li1 = $('.conRight li:nth-child(2)'),
        $Li2 = $('.conRight li:nth-child(4)'),
        $Li3 = $('.conRight li:nth-child(1)');

    timer = setTimeout(function() {

        img.stop().fadeOut(500);

    }, 100)

    $Li1.hover(function() {

        $('.telSnum').stop().slideDown(400);

    }, function() {
        $('.telSnum').stop().slideUp(400);
    });

    $Li2.hover(function() {
        $('.liuyan').stop().show(400);
    }, function() {
        $('.liuyan').stop().hide(400);
    });

    $Li3.hover(function() {
        $('.peopleCon').stop().show(400);
    }, function() {
        $('.peopleCon').stop().hide(400);
    });

    $li.hover(function() {

        clearTimeout(timer);

        img.stop().fadeIn(500);

    }, function() {

        img.stop().fadeOut(500);

    });

    img.hover(function() {

        clearTimeout(timer);

        img.stop().fadeIn(500);

    }, function() {

        clearTimeout(timer);

        img.stop().fadeOut(500);

    });

    // 获取当前屏幕的高度
    var viewHeight = 200;

    $(window).scroll(function(event) {

        var myTop = $(window).scrollTop();

        // 检测当前是否滚动一屏高度
        if (myTop > viewHeight) {

            $('.conRight').show(400);

        } else {

            $('.conRight').hide(400);

        };

    });

    $('.conRight li:last-child').click(function(event) {

        $('html,body').stop().animate({
            'scrollTop': 0
        }, 500);

    });
});
// 侧栏咨询结束
// 客户心声开始
$(function() {
    var lunboCon = $('.lunboCon');
    var lunboList = $('.lunboList li');
    var num = 0;
    var indexNum = 0;
    var len = lunboList.length;
    var timer = null;
    var lunbo = $('.lunbo');
    var imgWidth = lunboList.width();
    var huochetou = $('.lunboList');
    var rightBtn = $('.right_btn');
    var leftBtn = $('.left_btn');
    var boxWidth = $('.cusShow').width();
    var flag = true;

    // 点击右按钮让ul往左走
    rightBtn.click(rightFn);
    // 点击左按钮让ul往右走
    leftBtn.click(leftFn);

    timer = setInterval(leftFn, 6000);

    lunbo.hover(function() {

        clearTimeout(timer);

    }, function() {

        clearTimeout(timer);
        timer = setInterval(leftFn, 6000);
    });
    //往左走的功能
    function leftFn() {
        //让索引值++
        indexNum++;
        // 做一个判断
        if (indexNum > len - 1) {
            indexNum = 0;
        }

        num++;
        if (num > len) {
            // 一旦满足这个条件，就表示用户想要看到第“一”张，所以先瞬移到第0张，在顺势滑到第一张
            huochetou.css('left', 0);
            // 这个num一定要改成1
            num = 1;
        }

        go();
    }
    // 往右走的功能
    function rightFn() {

        //让索引值--
        indexNum--;
        // 做一个判断
        if (indexNum < 0) {
            indexNum = len - 1;
        }

        num--;
        if (num < 0) {
            // 一旦满足这个条件，就表示用户想要看到第“一”张，所以先瞬移到第0张，在顺势滑到第一张
            huochetou.css('left', -len * imgWidth);
            // 这个num一定要改成1
            num = len - 1;
        }

        go();

    }

    // 往左走的功能

    function go() {

        var s = -imgWidth * num;

        huochetou.stop().animate({
            'left': s
        }, 1000, function() {
            flag = true;
        });

    }
});
// 客户心声结束
// 客户图片显示对应的说明开始
$(function() {

    $('.lunboList li').mouseenter(function(event) {

        var index = $(this).index();

        $('.cusShow>li').eq(index).attr('class', 'current5').siblings().attr('class', '');
    })
});
var istrues = true,
    t = new Date().getTime();
var csrfToken = $("#_csrf").val() || $('meta[name="csrf-token"]').attr("content");

function list(id, num, tt) {
    if (istrues) {
        istrues = false;
        if (num == 5) {
            $("ul.sbshowad").html('<li><img src="../images/loading1.gif"></li>');
        }
        if (num == 8) {
            $("ul.contentSh").html('<li class="current3"><ul class="clearfix"><li style="margin-left: 390px; margin-top: 50px;"><img src="../images/loading1.gif"></li></ul></li>');
        }
        if (num == 12) {
            $("ul.currentShow").html('<li class="current"><ul class="clearfix"><li style="margin-left: 100px; margin-top: 50px;"><img src="../images/loading1.gif"></li></ul></li>');
        }

        //$.post("/products/forindex", {b: id,n:num,tt:tt,_csrf:csrfToken, t: Math.random()}, function (data) {
        $.ajax({
            type: "GET",
            url: "http://www.86sb.com/adv/sbadvad",
            dataType: 'jsonp',
            jsonp: 'callback',
            data: {
                id: 'all',
                lid: 48,
                page: 1,
                bigclassid: id,
                name: '',
                page_size: 8,
                _csrf: csrfToken,
                t: Math.random()
            },
            success: function(data) {

                if (num == 5) {
                    var html = '<style>.cc a{color:#666;font-weight: bold;}.cc a:hover {color: #bc0101;font-weight: bold;</style>';
                    if (data.result.data.length > 0) {
                        for (var i = 0; i < data.result.data.length; i++) {
                            if (i < num - 1) {
                                var str = data.result.data[i]['sbname'];
                                html += '<li style="height: 180px;">\
									   <a target="_blank" href="/info-' + data.result.data[i]['id'] + '.html" title="' + str + '商标转让">\
									   <img alt="' + str + '商标转让"  width="180" height="150"  src="' + data.result.data[i]['sbpic'] + (data.result.data[i]['sbpic'].indexOf("?") > -1 ? '&' : '?') + 'x-oss-process=image/resize,w_180,h_120">\
										</a><p style="text-align:center;"><span  class="cc"><a href="/info-' + data.result.data[i]['id'] + '.html"  target="_blank">' + str + '</a></span></p>\
								   </li> ';
                            }
                        }
                    } //else {
                    //html += '<li style="margin-left: 390px; margin-top: 50px;"><img src="/img/nodata1.png"></li>';
                    //  }
                    $("ul.sbshowad").html(html);
                }
                if (num == 8) {
                    var html = '<li class="current3" ><ul class="clearfix">';
                    if (data.result.data.length > 0) {
                        for (var i = 0; i < data.result.data.length; i++) {
                            if (i < num) {
                                var str = data.result.data[i]['sbname'];
                                html += '<li style="background:#fff;">\
									   <a target="_blank" href="/info-' + data.result.data[i]['id'] + '.html" title="' + str + '商标转让">\
											<img alt="' + str + '商标转让" width="215" height="160" src="' + data.result.data[i]['sbpic'] + '@!hyjs">\
											 <p>' + str.substr(0, 8) + '</p>\
									   </a>\
								   </li> ';
                            }
                        }
                    } else {
                        html += '<li style="margin-left: 250px; margin-top: 50px;"><a href="javascript:void(0);" onClick="toswt();return false;" ><img src="/img/nodata1.png"></a></li>';
                    }
                    html += '</ul></li>';
                    $("ul.contentSh").html(html);
                }
                if (num == 12) {
                    var html = '<li class="current"><ul class="clearfix">';
                    if (data.result.data.length > 0) {
                        for (var i = 0; i < data.result.data.length; i++) {
                            if (i < num) {
                                var str = data.result.data[i]['sbname'];
                                html += '<li>\
									   <a target="_blank" href="/info-' + data.result.data[i]['id'] + '.html" title="' + str + '商标转让">\
										<img alt="' + str + '商标转让" width="170" height="100" src="' + data.result.data[i]['sbpic'] + '@!sytjc">\
										 </a>\
								   </li> ';
                            }
                        }
                    } else {
                        html += '<li style="margin-left: 300px; margin-top: 15px;"><a href="javascript:void(0);" onClick="toswt();return false;" ><img src="/img/nodata1.png"></a></li>';
                    }
                    html += '</ul></li>';
                    $("ul.currentShow").html(html);
                }
                istrues = true;
            }

        });
        // }, "json");
    }
}

// 客户图片显示对应的说明结束
// 商品分类开始
$(function() {

    $('.sideBarList li').mouseenter(function(event) {

        var index = $(this).index();
        list(parseInt(index) + 1, 8, 1);
        //alert(index);


        $('.sideBarList li').eq(index).attr('class', 'current4').siblings().attr('class', '');
        $('.contentSh>li').eq(index).attr('class', 'current3').siblings().attr('class', '');
    });

    $('.sideBarList').niceScroll({
        cursorcolor: "#c80101", //#CC0071 光标颜色
        cursoropacitymax: 1, //改变不透明度非常光标处于活动状态（scrollabar“可见”状态），范围从1到0
        touchbehavior: false, //使光标拖动滚动像在台式电脑触摸设备
        cursorwidth: "8px", //像素光标的宽度
        cursorborder: "0", // 	游标边框css定义
        cursorborderradius: "5px", //以像素为光标边界半径
        autohidemode: true //是否隐藏滚动条
    });
});
// 商品分类结束
// 友情链接开始
function srcMarquee() {
    this.ID = document.getElementById(arguments[0]);
    if (!this.ID) {
        this.ID = -1;
        return;
    }
    this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.Correct = this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
    this.Step = 1;
    this.Timer = 30;
    this.DirectionArray = {
        "top": 0,
        "bottom": 1,
        "left": 2,
        "right": 3
    };
    if (typeof arguments[1] == "number") this.Direction = arguments[1];
    if (typeof arguments[2] == "number") this.Step = arguments[2];
    if (typeof arguments[3] == "number") this.Width = arguments[3];
    if (typeof arguments[4] == "number") this.Height = arguments[4];
    if (typeof arguments[5] == "number") this.Timer = arguments[5];
    if (typeof arguments[6] == "number") this.DelayTime = arguments[6];
    if (typeof arguments[7] == "number") this.WaitTime = arguments[7];
    if (typeof arguments[8] == "number") this.ScrollStep = arguments[8];
    this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
    this.ID.noWrap = true;
    this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1);
    if (arguments.length >= 7) this.Start();
}
srcMarquee.prototype.Start = function() {
    if (this.ID == -1) return;
    if (this.WaitTime < 800) this.WaitTime = 800;
    if (this.Timer < 20) this.Timer = 20;
    if (this.Width == 0) this.Width = parseInt(this.ID.style.width);
    if (this.Height == 0) this.Height = parseInt(this.ID.style.height);
    if (typeof this.Direction == "string") this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()];
    this.HalfWidth = Math.round(this.Width / 2);
    this.BakStep = this.Step;
    this.ID.style.width = this.Width;
    this.ID.style.height = this.Height;
    if (typeof this.ScrollStep != "number") this.ScrollStep = this.Direction > 1 ? this.Width : this.Height;
    var msobj = this;
    var timer = this.Timer;
    var delaytime = this.DelayTime;
    var waittime = this.WaitTime;
    msobj.StartID = function() {
        msobj.Scroll()
    }
    msobj.Continue = function() {
        if (msobj.MouseOver == 1) {
            setTimeout(msobj.Continue, delaytime);
        } else {
            clearInterval(msobj.TimerID);
            msobj.CTL = msobj.Stop = 0;
            msobj.TimerID = setInterval(msobj.StartID, timer);
        }
    }
    msobj.Pause = function() {
        msobj.Stop = 1;
        clearInterval(msobj.TimerID);
        setTimeout(msobj.Continue, delaytime);
    }
    msobj.Begin = function() {
        msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth : msobj.ID.scrollHeight;
        if ((msobj.Direction <= 1 && msobj.ClientScroll < msobj.Height) || (msobj.Direction > 1 && msobj.ClientScroll < msobj.Width)) return;
        msobj.ID.innerHTML += msobj.ID.innerHTML;
        msobj.TimerID = setInterval(msobj.StartID, timer);
        if (msobj.ScrollStep < 0) return;
        msobj.ID.onmousemove = function(event) {
            if (msobj.ScrollStep == 0 && msobj.Direction > 1) {
                var event = event || window.event;
                if (window.event) {
                    if (msobj.IsNotOpera) {
                        msobj.EventLeft = event.srcElement.id == msobj.ID.id ? event.offsetX - msobj.ID.scrollLeft : event.srcElement.offsetLeft - msobj.ID.scrollLeft + event.offsetX;
                    } else {
                        msobj.ScrollStep = null;
                        return;
                    }
                } else {
                    msobj.EventLeft = event.layerX - msobj.ID.scrollLeft;
                }
                msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2;
                msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft);
                msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep * 2) / msobj.HalfWidth);
            }
        }
        msobj.ID.onmouseover = function() {
            if (msobj.ScrollStep == 0) return;
            msobj.MouseOver = 1;
            clearInterval(msobj.TimerID);
        }
        msobj.ID.onmouseout = function() {
            if (msobj.ScrollStep == 0) {
                if (msobj.Step == 0) msobj.Step = 1;
                return;
            }
            msobj.MouseOver = 0;
            if (msobj.Stop == 0) {
                clearInterval(msobj.TimerID);
                msobj.TimerID = setInterval(msobj.StartID, timer);
            }
        }
    }
    setTimeout(msobj.Begin, waittime);
}
srcMarquee.prototype.Scroll = function() {
        switch (this.Direction) {
            case 0:
                this.CTL += this.Step;
                if (this.CTL >= this.ScrollStep && this.DelayTime > 0) {
                    this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL;
                    this.Pause();
                    return;
                } else {
                    if (this.ID.scrollTop >= this.ClientScroll) {
                        this.ID.scrollTop -= this.ClientScroll;
                    }
                    this.ID.scrollTop += this.Step;
                }
                break;
            case 1:
                this.CTL += this.Step;
                if (this.CTL >= this.ScrollStep && this.DelayTime > 0) {
                    this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL;
                    this.Pause();
                    return;
                } else {
                    if (this.ID.scrollTop <= 0) {
                        this.ID.scrollTop += this.ClientScroll;
                    }
                    this.ID.scrollTop -= this.Step;
                }
                break;
            case 2:
                this.CTL += this.Step;
                if (this.CTL >= this.ScrollStep && this.DelayTime > 0) {
                    this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL;
                    this.Pause();
                    return;
                } else {
                    if (this.ID.scrollLeft >= this.ClientScroll) {
                        this.ID.scrollLeft -= this.ClientScroll;
                    }
                    this.ID.scrollLeft += this.Step;
                }
                break;
            case 3:
                this.CTL += this.Step;
                if (this.CTL >= this.ScrollStep && this.DelayTime > 0) {
                    this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL;
                    this.Pause();
                    return;
                } else {
                    if (this.ID.scrollLeft <= 0) {
                        this.ID.scrollLeft += this.ClientScroll;
                    }
                    this.ID.scrollLeft -= this.Step;
                }
                break;
        }
    }
    // 友情链接结束

// placeholder兼容性
$(document).ready(function() {
    var doc = document,
        inputs = doc.getElementsByTagName('input'),
        supportPlaceholder = 'placeholder' in doc.createElement('input'),
        placeholder = function(input) {
            var text = input.getAttribute('placeholder'),
                defaultValue = input.defaultValue;
            if (defaultValue == '') {
                input.value = text
            }
            input.onfocus = function() {
                if (input.value === text) {
                    this.value = ''
                }
            };
            input.onblur = function() {
                if (input.value === '') {
                    this.value = text
                }
            }
        };
    if (!supportPlaceholder) {
        for (var i = 0, len = inputs.length; i < len; i++) {
            var input = inputs[i],
                text = input.getAttribute('placeholder');
            if (input.type === 'text' && text) {
                placeholder(input)
            }
        }
    }
});
// 中间弹出框开始
jQuery(document).ready(function($) {
    var close = $('.close');
    var consult = $('.consult');
    var wirte = $('.wirte');
    var right = $('.right');
    var timer = null;

    close.click(function(event) {
        consult.stop().hide(400)
    });

});
// 商标转让列表
// 内容部分开始
// 服装鞋帽开始
$(function() {
    var $Li = $('.clothTitle li');
    var $Cli = $('.clothConTo>li');
    var $em = $('.spRight>em');
    var $add = $('.add');
    var $ask = $('.ask');
    var $close3 = $('.close3');
    var $sTwo = $('.sTwo');
    var $sThree = $('.sThree');
    var $sFour = $('.sFour');
    var $up = $('.sTwo>em.up');
    var $up1 = $('.sThree>em.up');
    var $up2 = $('.sFour>em.up');
    var $online = $('.online');
    // 点击红心变色
    $add.click(function(event) {

        // $(this).css('background', '');

        // $(this).css('color', '');

        $(this).css({
            'background': 'url(../images/redHeart.jpg) 4px center no-repeat',
            'color': '#c80101'
        });

        $(this).html('已收藏');

    });


    $ask.click(function(event) {

        $('.askShow').stop().show();

    });

    $close3.click(function(event) {

        $('.askShow').stop().hide();

        $collect1.stop().hide();

        $('.onlineCon').stop().hide();

    });

    $sTwo.click(function(event) {

        $up.removeClass('up').addClass('down');

    });

    $sThree.click(function(event) {

        $up1.removeClass('up').addClass('down');

    });

    $sFour.click(function(event) {

        $up2.removeClass('up').addClass('down');

    });

});
// 科学仪器开始
$(function() {
    var $Li = $('.toolTitle li');
    var $Cli = $('.toolConTo>li');
    var $em = $('.spRight>em');

    $em.click(function(event) {

        $(this).css('backgroundImage', 'url(../images/redHeart.jpg)');

    });

});
// 珠宝首饰开始
$(function() {
    var $Li = $('.gemTitle li');
    var $Cli = $('.gemConTo>li');
    var $em = $('.spRight>em');

    $em.click(function(event) {

        $(this).css('backgroundImage', 'url(../images/redHeart.jpg)');

    });

});

// 内容部分结束
// 修改密码开始
$(function() {
    var next1 = $('.next1');
    var next2 = $('.next2');
    var next3 = $('.next3');
    var $Li = $('.reProCon li');
    var $A = $('.reProCon>li:nth-child(3) ul li:nth-child(4) a');


    next1.click(function(event) {
        $Li.eq(0).hide();
        $('.reProCon>li:nth-child(2)').show();

    });

    next2.click(function(event) {

        $('.reProCon>li:nth-child(2)').hide();

        $('.reProCon>li:nth-child(3)').show();

    });

    $A.click(function(event) {

        $('.reProCon>li:nth-child(3)').hide();

        $('.reProCon>li:nth-child(4)').show();

    });

    next3.click(function(event) {

        $('.reProCon>li:nth-child(4)').hide();

        $('.reProCon>li:nth-child(5)').show();
    });

});
// 修改密码结束
/*-------注册验证-----------*/
$().ready(function() {
    $("#signupForm").validate({
        rules: {
            telphone: {
                required: true,
                rangelength: [11, 11],
                digits: "只能输入整数"
            },
            password: {
                required: true,
                rangelength: [8, 20]
            },
            confirm_password: {
                required: true,
                equalTo: "#password",
                rangelength: [8, 20]
            }
        },
        messages: {
            telphone: {
                required: "请输入手机号",
                rangelength: $.validator.format("请输入正确的手机号")
            },
            password: {
                required: "请输入密码",
                rangelength: $.validator.format("密码在8~20个字符之间")
            },
            confirm_password: {
                required: "请输入确认密码",
                rangelength: $.validator.format("密码在8~20个字符之间"),
                equalTo: "两次输入密码不一致"
            }
        }
    });
});
// 登陆开始
$().ready(function() {
    var loginIn1 = $('.loginIn1');
    var loginIn2 = $('.loginIn2');
    var subMit = $('.subMit');
    var cur1 = $('.cur1');
    var cur2 = $('.cur2');

    subMit.click(function() {
        $(".loginList>li").find("input[type='text']").each(function() {
            if ($(this).val() == "" && $(this).val().length < 11) {

                cur1.stop().show();

                cur2.stop().show();

            } else {

                cur1.stop().hide();

                cur2.stop().hide();
            }
        })
    })
});
// 登陆结束
// 诚聘英才开始
$().ready(function() {

    var $Li1 = $('.conList li:nth-child(1)');
    var $Li2 = $('.conList li:nth-child(2)');
    var $Li3 = $('.conList li:nth-child(3)');
    var $Li4 = $('.conList li:nth-child(4)');
    var $manager1 = $('.manager1');
    var $manager2 = $('.manager2');
    var $manager3 = $('.manager3');
    var $manager4 = $('.manager4');
    var $managerL = $('.managerL');


    $manager1.click(function(event) {

        $Li1.stop().animate({
            'height': 340
        }, 500).siblings().stop().animate({
            'height': 30
        }, 500);

        $managerL.stop().show();

        $manager1.css('background', '#c80101 url(../images/rclose.png) 870px center no-repeat');

        $manager2.css('background', '#a6a6a6 url(../images/ropen.png) 870px center no-repeat');

        $manager3.css('background', '#a6a6a6 url(../images/ropen.png) 870px center no-repeat');

        $manager4.css('background', '#a6a6a6 url(../images/ropen.png) 870px center no-repeat');


    });

    $manager2.click(function(event) {

        $Li2.stop().animate({
            'height': 340
        }, 500).siblings().stop().animate({
            'height': 30
        }, 500);

        $managerL.stop().hide();

        $manager1.css('background', '#a6a6a6 url(../images/ropen.png) 870px center no-repeat');

        $manager2.css('background', '#c80101 url(../images/rclose.png) 870px center no-repeat');

        $manager3.css('background', '#a6a6a6 url(../images/ropen.png) 870px center no-repeat');

        $manager4.css('background', '#a6a6a6 url(../images/ropen.png) 870px center no-repeat');

    });

    $manager3.click(function(event) {

        $Li3.stop().animate({
            'height': 340
        }, 500).siblings().stop().animate({
            'height': 30
        }, 500);

        $manager1.css('background', '#a6a6a6 url(../images/ropen.png) 870px center no-repeat');

        $manager2.css('background', '#a6a6a6 url(../images/ropen.png) 870px center no-repeat');

        $manager3.css('background', '#c80101 url(../images/rclose.png) 870px center no-repeat');

        $manager4.css('background', '#a6a6a6 url(../images/ropen.png) 870px center no-repeat');

        $managerL.stop().hide();
    });

    $manager4.click(function(event) {

        $Li4.stop().animate({
            'height': 340
        }, 500).siblings().stop().animate({
            'height': 30
        }, 500);

        $manager1.css('background', '#a6a6a6 url(../images/ropen.png) 870px center no-repeat');

        $manager2.css('background', '#a6a6a6 url(../images/ropen.png) 870px center no-repeat');

        $manager3.css('background', '#a6a6a6 url(../images/ropen.png) 870px center no-repeat');

        $manager4.css('background', '#c80101 url(../images/rclose.png) 870px center no-repeat');

        $managerL.stop().hide();

    });
});
// 诚聘英才结束
// 服装鞋帽开始
$(function() {
    var $Li = $('.clothTitle li');
    var $Cli = $('.clothConTo>li');
    var $em = $('.clothCon li span>em');
    // 点击红心变色
    $em.click(function(event) {

        $(this).css('backgroundImage', 'url(../images/redHeart.jpg)');

    });

    $Li.mouseenter(function(event) {

        var index = $(this).index();

        $Li.eq(index).attr('class', 'current1').siblings().attr('class', '');

        $Cli.eq(index).attr('class', 'current').siblings().attr('class', '');

    })

});
// 科学仪器开始
$(function() {
    var $Li = $('.toolTitle li');
    var $Cli = $('.toolConTo>li');
    var $em = $('.toolCon li span>em');

    $em.click(function(event) {

        $(this).css('backgroundImage', 'url(../images/redHeart.jpg)');

    });

    $Li.mouseenter(function(event) {

        var index = $(this).index();

        $Li.eq(index).attr('class', 'current2').siblings().attr('class', '');

        $Cli.eq(index).attr('class', 'current3').siblings().attr('class', '');

    })

});
// 珠宝首饰开始
$(function() {
    var $Li = $('.gemTitle li');
    var $Cli = $('.gemConTo>li');
    var $em = $('.gemCon li span>em');

    $em.click(function(event) {

        $(this).css('backgroundImage', 'url(../images/redHeart.jpg)');

    });

    $Li.mouseenter(function(event) {

        var index = $(this).index();

        $Li.eq(index).attr('class', 'current4').siblings().attr('class', '');

        $Cli.eq(index).attr('class', 'current5').siblings().attr('class', '');

    })

});
// 帮助中心侧栏开始
$(function() {

    var $input = $('.chart>input');
    var $subm = $('.subm');
    var $box = $('.box');
    var $content = $('.content');
    var height = $box.height();
    var height1 = $content.height();


    $subm.click(function(event) {

        if ($input.val() == "") {

            alert('你的信息未填写完整!')

        } else {



        };

    });

    $('.list p').click(function() {
        // 如果具备了这个类让其还俗
        if ($(this).parent().hasClass('current')) {
            //还俗
            $(this).parent().removeClass('current');
        } else {
            //如果没有具备这个类，就让他添加上这个类
            $(this).parent().addClass('current');
            // 最后实现排他
            $(this).parent().siblings().removeClass('current');
        }
    })
});
// 帮助中心侧栏结束
//2016-9-13  精品商标修改
var istrues = true,
    t = new Date().getTime();
//var csrfToken = $("#_csrf").val() || $('meta[name="csrf-token"]').attr("content");
function adv(id, num) {
    if (istrues) {
        istrues = false;
        $("ul.currentShow").html('<li class="current"><ul class="clearfix"><li style="margin-left: 100px; margin-top: 50px;"><img src="../images/loading1.gif"></li></ul></li>');
        $.post("/adv/sbadv", {
            b: id,
            n: num,
            _csrf: csrfToken,
            t: Math.random()
        }, function(data) {
            istrues = true;
            var html = '<li class="current"><ul class="clearfix">';
            if (data.result.length > 0) {
                for (var i = 0; i < data.result.length; i++) {
                    var str = data.result[i]['atitle'];
                    html += '<li>\
                                    <a target="_blank" href="' + data.result[i]['link'] + '" title="' + str + '">\
                                   <img alt="尚标-' + str + '"  width="170" height="100"  src="' + data.result[i]['pic'] + '@!sytjc">\
                                    </a>\
                               </li> ';
                }
            } else {
                html += '<li style="margin-left: 300px; margin-top: 15px;"><a href="javascript:void(0);" onClick="toswt();return false;" ><img src="../images/nodata1.png"></a></li>';
            }
            html += '</ul></li>';
            $("ul.currentShow").html(html);
        }, "json");
    }
}